using UnityEngine;
using System.Collections;

[System.Serializable]
public class ChangePhysicsContraints : CharacterAction {
    public bool revert = true;
    public RigidbodyConstraints currentConstraints;
    private RigidbodyConstraints defaultContraints;
	
	public override void OnActionEnter(Character character)
	{   
        defaultContraints = character.rigidbodyRef.constraints;
        character.rigidbodyRef.constraints = currentConstraints;
	}

    public override void OnActionExit(Character character)
    {
        if(revert)
        {
            character.rigidbodyRef.constraints = defaultContraints;
        }
    }
    
}
